<!-- 添加字典类型 -->
<template>
  <div>
    <el-dialog
      title="修改字典类型"
      :visible.sync="ishowDialog"
      width="30%"
      :before-close="closeDialog"
      size="mini"
    >
      <el-form
        ref="dictTypeForm"
        :model="dictTypeForm"
        label-width="80px"
        size="mini"
      >
        <el-form-item label="字典名称">
          <el-input v-model="dictTypeForm.name"></el-input>
        </el-form-item>
        <el-form-item label="字典类型">
          <el-input v-model="dictTypeForm.type"></el-input>
        </el-form-item>
        <el-form-item label="是否启用">
          <el-radio-group v-model="dictTypeForm.enable">
            <el-radio
              v-for="item in enables"
              :key="item.name"
              :label="item.value"
              >{{ item.name }}</el-radio
            >
          </el-radio-group>
        </el-form-item>
        <el-form-item label="备注">
          <el-input type="textarea" v-model="dictTypeForm.remark"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="addSubmit()" size="mini"
            >确定</el-button
          >
          <el-button @click="closeDialog()" size="mini">取消</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    enables: {
      type: Array,
    },
    data: {
      type: Object,
    },
  },
  data() {
    return {
      ishowDialog: true,
      dictTypeForm: {},
    };
  },
  created() {
    this.dictTypeForm = this.data;
  },
  mounted() {},
  methods: {
    /**
     * 关闭对话框
     */
    closeDialog() {
      this.$emit("close");
    },
    /**
     * 提交添加
     */
    addSubmit() {
      this.$emit("submit", this.dictTypeForm);
    },
  },
};
</script>
<style scoped>
/* @import url(); 引入css类 */
</style>